
{% extends 'blog/base.html' %}

{% block title %}
    {% if tag %}
        标签页:{{ tag.name }}
    {% elif category %}
        分类页:{{ category.name }}
    {% else %}
        首页--
    {% endif %}
{% endblock %}

{% block main %}
    {% for article in article_list %}
        <a href="{% url 'blog:article-detail' article.id %}">{{ article.title }}</a>
        |{{ article.create_time }}
        <hr/>
    {% endfor %}
    {% if page_obj %}
        {% if page_obj.has_previous %}
            <a href="?page={{ page_obj.previous_page_number }}">上一页</a>
        {% endif %}
        Page {{ page_obj.number }} of {{ paginator.num_pages }}.
        {% if page_obj.has_next %}
            <a href="?page={{ page_obj.next_page_number }}">下一页</a>
        {% endif %}
    {% endif %}
{% endblock %}